import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import Login from '@/views/Login.vue'
import NotFound from '@/views/NotfindView.vue'
import SearchView from '@/views/SerchPop.vue'
import CartView from '@/views/cart/index.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/search',
    name: '/search',
    component: SearchView,
  },
  {
    path: '/cart',
    name: '/cart',
    component: CartView,
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'notfind',
    component: NotFound
  },

]
const router = new VueRouter({
  routes,
  mode: 'history',
})

export default router
